package com.wulis.provider.basic.mapper;

import com.wulis.provider.basic.model.entity.Department;
import com.wulis.common.support.BaseMapper;
import com.wulis.provider.basic.model.vo.QueryDepartmentTreeVo;
import com.wulis.provider.basic.model.vo.QueryDepartmentVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 基础信息管理：部门信息表 Mapper
 *
 * @author WuliBao
 * @date 2020-05-21
 */
public interface DepartmentMapper extends BaseMapper<Department> {
    
    /**
     * WEB:查询部门信息列表
     * 
     * @param organizationId organizationId
     * @param departmentName departmentName
     * @param enable enable
     * @return List
     */
    List<QueryDepartmentTreeVo> queryDepartmentList(@Param("organizationId") Long organizationId,
        @Param("departmentName") String departmentName, @Param("enable") Integer enable);
    
    /**
     * WEB:查询部门信息
     * 
     * @param id id
     * @return QueryDepartmentVo
     */
    QueryDepartmentVo queryDepartment(@Param("id") Long id);
    
    /**
     * WEB:修改下级部门关联的机构ID及parentIds
     * 
     * @param organizationId organizationId
     * @param oldParentIds oldParentIds
     * @param newParentIds newParentIds
     * @return int
     */
    int updateChildDepartment(@Param("organizationId") Long organizationId, @Param("oldParentIds") String oldParentIds,
        @Param("newParentIds") String newParentIds);
}
